//
//  ConfiGurableTextView.h
//  CLHComponents
//
//  Created by 曹连华 on 2020/9/8.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@class ConfiGurableTextView;

@protocol ConfiGurableTextViewDelegate <UITextViewDelegate>

@optional

- (void)titleDidClickedString:(NSString *)string urlString:(NSString *)urlString;

- (BOOL)textViewShouldReturn:(UITextView *)textView;

@end

@interface ConfiGurableTextView : UITextView

/** 最大输入长度 */
@property (nonatomic, assign) NSInteger maxLength;
/** 是否禁止输入表情 */
@property (nonatomic, assign) BOOL banEmoji;
/** 是否禁止输入空格 */
@property (nonatomic, assign) BOOL banBlank;
/** 是否禁止 手动换行 */
@property (nonatomic, assign) BOOL banLineFeed;
/** 是否根据输入的文本 动态改变 TextView.frame.size.height  defout NO */
@property (nonatomic, assign) BOOL dynamicHeight;
/** 点击 return 是否收起键盘 defout NO */
@property (nonatomic, assign) BOOL returnShouldResignFirstResponder;


/*supportRichText 是否支持 可点击富文本*/
- (instancetype)initWithFrame:(CGRect)frame supportAttributed:(BOOL)supportAttributed;

/** 富文本 */
@property(nonatomic, strong) NSAttributedString *attributedString;
/** 文字的属性 */
@property(nonatomic, strong) NSDictionary *attributeDic;

/** key 选中的文字
   value 点击选中文字要跳转的链接 */
@property (nonatomic, copy) NSDictionary *selectedStrUrlDic;
/** 选中的文字属性*/
@property(nonatomic, strong) NSDictionary *selectedAttributeDic;

@property (nonatomic, strong, readonly) UILabel *placeholderLabel;

@property (nonatomic, weak) id <ConfiGurableTextViewDelegate>confiDelegate;

@end

NS_ASSUME_NONNULL_END
